--------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /a/hreflx1/lcl/href/research4/m1hxs02/Gas_price/ReadMe/Codes/gphv_setup.log
  log type:  text
 opened on:  20 May 2011, 14:53:07

. **********************
. *Summary Statistics
. **********************
. 
. sort zipcode year

. sum m2_1980 if zipcode~=zipcode[_n-1], d

                           m2_1980
-------------------------------------------------------------
      Percentiles      Smallest
 1%     14.05578          6.875
 5%     15.86465       7.262411
10%     16.99362            7.5       Obs                4250
25%     19.06964       9.398569       Sum of Wgt.        4250

50%     22.02175                      Mean           22.96787
                        Largest       Std. Dev.      5.582346
75%     25.74262       50.21857
90%     29.92082       50.78424       Variance       31.16258
95%     33.41324       53.33185       Skewness       1.215083
99%     42.06491       55.86362       Kurtosis       5.428796

. sum dhpy_zip, d

                          dhpy_zip
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -.1972162        -.65706
 5%    -.0770267      -.6082354
10%    -.0424494      -.5952533       Obs              119000
25%      .002386      -.5635232       Sum of Wgt.      119000

50%      .041063                      Mean           .0429392
                        Largest       Std. Dev.      .0815503
75%     .0842221        .398637
90%     .1386706        .401175       Variance       .0066504
95%     .1782257       .4125796       Skewness      -.5107057
99%     .2534242       .4216486       Kurtosis        7.13502

. scalar cpi1977=60.6

. scalar cpi1978=65.2

. scalar cpi1979=72.6

. scalar cpi1980=82.4

. scalar cpi1981=90.9

. scalar cpi1982=96.5

. scalar cpi1983=99.6

. scalar cpi1984=103.9

. scalar cpi1985=107.6

. scalar cpi1986=109.6

. scalar cpi1987=113.6

. scalar cpi1988=118.3

. scalar cpi1989=124.0

. scalar cpi1990=130.7

. scalar cpi1991=136.2

. scalar cpi1992=140.3

. scalar cpi1993=144.5

. scalar cpi1994=148.2

. scalar cpi1995=152.4

. scalar cpi1996=156.9

. scalar cpi1997=160.5

. scalar cpi1998=163.0

. scalar cpi1999=166.6

. scalar cpi2000=172.2

. scalar cpi2001=177.1

. scalar cpi2002=179.9

. scalar cpi2003=184.0

. scalar cpi2004=188.9

. scalar cpi2005=195.3

. scalar cpi2006=201.6

. scalar cpi2007=207.3

. scalar cpi2008=215.3

. gen rhpy_zip=.
(119000 missing values generated)

. foreach i of numlist 1980/2007 {
  2.         local j=`i'+1
  3.         replace rhpy_zip=dhpy_zip-log(cpi`j'/cpi`i') if year==`i'
  4. }
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)

. sum dhpy_zip

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
    dhpy_zip |    119000    .0429392    .0815503    -.65706   .4216486

. sum rhpy_zip, d

                          rhpy_zip
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -.2338849      -.6949254
 5%    -.1186163      -.6461008
10%    -.0851333      -.6331187       Obs              119000
25%    -.0363908      -.6013886       Sum of Wgt.      119000

50%     .0079677                      Mean           .0086375
                        Largest       Std. Dev.      .0848328
75%     .0537375       .3674295
90%     .1094329       .3716784       Variance       .0071966
95%     .1479679       .3792605       Skewness      -.4623918
99%      .226238       .3866569       Kurtosis       6.481289

. gen rhpy_zip4y=.
(119000 missing values generated)

. foreach i of numlist 1980/2007 {
  2.         local j=`i'+1
  3.         local k=`i'-3
  4.         replace rhpy_zip4y=dhpy_zip4y-log(cpi`j'/cpi`k') if year==`i'
  5. }
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)
(4250 real changes made)

. sum dhpy_zip4y, d

                         dhpy_zip4y
-------------------------------------------------------------
      Percentiles      Smallest
 1%      -.24087      -.7244589
 5%    -.1061664      -.6839551
10%    -.0324296      -.6500863       Obs              119000
25%     .0777668      -.6420318       Sum of Wgt.      119000

50%     .1874904                      Mean           .2109843
                        Largest       Std. Dev.      .2098876
75%     .3319446       1.003364
90%     .4884687       1.008968       Variance       .0440528
95%     .5984968       1.011161       Skewness       .4465842
99%     .7893267       1.023447       Kurtosis        3.58233

. sum rhpy_zip4y, d

                         rhpy_zip4y
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -.3973108      -.8552735
 5%    -.2766965      -.8147697
10%    -.2063872       -.780901       Obs              119000
25%    -.0880861      -.7728464       Sum of Wgt.      119000

50%     .0366501                      Mean           .0571015
                        Largest       Std. Dev.      .2217561
75%      .176908       .9017297
90%     .3575736       .9045615       Variance       .0491758
95%     .4770263       .9133391       Skewness       .5175638
99%     .6717647       .9256245       Kurtosis       3.529008

. 
. sort year zipcode

. sum drgp if year~=year[_n-1], d

                            drgp
-------------------------------------------------------------
      Percentiles      Smallest
 1%    -.2776534      -.2776534
 5%    -.1575693      -.1575693
10%     -.111432       -.111432       Obs                  28
25%    -.0528219      -.0825393       Sum of Wgt.          28

50%    -.0123962                      Mean           .0071643
                        Largest       Std. Dev.      .1072194
75%     .0812592       .1405264
90%     .1429596       .1429596       Variance        .011496
95%     .1759049       .1759049       Skewness      -.2142169
99%     .2338973       .2338973       Kurtosis       3.518841

. codebook zipcode

--------------------------------------------------------------------------------------------------------------------------------------
zipcode                                                                                                                    (unlabeled)
--------------------------------------------------------------------------------------------------------------------------------------

                  type:  string (str6)

         unique values:  4250                     missing "":  0/119000

              examples:  "Z23663"
                         "Z44129"
                         "Z70003"
                         "Z8723"

. codebook cbsacode

--------------------------------------------------------------------------------------------------------------------------------------
cbsacode                                                                                                                     CBSA_code
--------------------------------------------------------------------------------------------------------------------------------------

                  type:  numeric (double)

                 range:  [10420,49700]                units:  10
         unique values:  202                      missing .:  0/119000

                  mean:   30332.4
              std. dev:     11015

           percentiles:        10%       25%       50%       75%       90%
                             14460     19100     33100     39100     42660

. sort cbsacode zipcode year

. sum count if cbsacode~=cbsacode[_n-1], d

                            count
-------------------------------------------------------------
      Percentiles      Smallest
 1%            2              2
 5%            2              2
10%            2              2       Obs                 202
25%            4              2       Sum of Wgt.         202

50%            8                      Mean            21.0396
                        Largest       Std. Dev.      38.63683
75%           20            175
90%           52            178       Variance       1492.804
95%           84            206       Skewness       4.841153
99%          178            356       Kurtosis       34.42302

. sum landarea1990 if zipcode~=zipcode[_n-1], d

                        landarea1990
-------------------------------------------------------------
      Percentiles      Smallest
 1%        2.945           .706
 5%        5.911           .832
10%       8.4325           .903       Obs                4250
25%       14.995          1.086       Sum of Wgt.        4250

50%       30.991                      Mean           80.80857
                        Largest       Std. Dev.      154.6837
75%       78.888       1861.802
90%      197.254       1892.401       Variance       23927.05
95%      322.815       2016.592       Skewness       6.544852
99%      744.941       3175.572       Kurtosis       76.06606

. sum units1980 if zipcode~=zipcode[_n-1], d

     Total Housing Units (Including Vacant Seasonal and
                      Migratory Units)
-------------------------------------------------------------
      Percentiles      Smallest
 1%          320             19
 5%         1445             20
10%       2352.5             30       Obs                4250
25%         4736             35       Sum of Wgt.        4250

50%       8514.5                      Mean           9565.495
                        Largest       Std. Dev.      6340.747
75%        13077          38051
90%        17990          38971       Variance       4.02e+07
95%        21680          39914       Skewness       1.018124
99%        29702          40735       Kurtosis       4.275936

. sum m2_1980 if zipcode~=zipcode[_n-1], d

                           m2_1980
-------------------------------------------------------------
      Percentiles      Smallest
 1%     14.05578          6.875
 5%     15.86465       7.262411
10%     16.99362            7.5       Obs                4250
25%     19.06964       9.398569       Sum of Wgt.        4250

50%     22.02175                      Mean           22.96787
                        Largest       Std. Dev.      5.582346
75%     25.74262       50.21857
90%     29.92082       50.78424       Variance       31.16258
95%     33.41324       53.33185       Skewness       1.215083
99%     42.06491       55.86362       Kurtosis       5.428796

. 
. keep zipcode cbsacode cbsaname year dhpy_zip* rhpy*_zip* d*_m* d*_dens d*_rm m*_m* sngfam1980 income1980 m2_1980 p3_1980 m2_2000 p2_
> 2000 density1980 stfips1980 count totcount diffcomm1980 totdiffcomm1980 rural1980 m3_1980 landarea1990 sdcomm1980 units1980 density2
> 000

. egen cbsatime=group(cbsacode year)

. gen zip=real(substr(zipcode, 2, 6))

. sort zip

. capture drop _m

. merge m:1 zip using Data/zip_to_place_1990.dta
zip was float now double

    Result                           # of obs.
    -----------------------------------------
    not matched                        21,896
        from master                     3,976  (_merge==1)
        from using                     17,920  (_merge==2)

    matched                           115,024  (_merge==3)
    -----------------------------------------

. drop if _m==2
(17920 observations deleted)

. drop _m hh1990 alloc_factor

. sort place zipcode year

. compress
year was float now int
stfips1980 was float now byte
sngfam1980 was float now int
totcount was float now int
count was float now int
cbsatime was float now int
cbsacode was double now long
zip was double now long

. 
. save Data/zip19802009_panel.dta, replace
(note: file Data/zip19802009_panel.dta not found)
file Data/zip19802009_panel.dta saved

. 
. log close
      name:  <unnamed>
       log:  /a/hreflx1/lcl/href/research4/m1hxs02/Gas_price/ReadMe/Codes/gphv_setup.log
  log type:  text
 closed on:  20 May 2011, 14:53:12
--------------------------------------------------------------------------------------------------------------------------------------
